import { TextInput, Create, SaveButton, DateTimeInput ,SimpleForm,required} from 'react-admin';

import { dataProvider } from '../../dataProvider/DataProvider';

export const ContactEventCreateForm = () => {

    const create = (data) =>{
        dataProvider.createContactEvent(data,callback);
    }

    const callback=(ret)=>{
        console.info('callback',ret);
    }
   
    return (

        <Create>
            <SimpleForm onSubmit={create}>
                <TextInput source="eventName" label="通联活动" validate={required()} />
                <TextInput source="opCallsign" label="OP" validate={required()}/>
                <TextInput source="recorder" label="记录员" />
                <TextInput source="frequency" label="频率" />
                <TextInput source="qth" label="QTH" />
                <TextInput source="rig" label="设备" />
                <TextInput source="ant" label="天线" />
                <TextInput source="power" label="功率" />
                <TextInput source="height" label="高度" />
                <DateTimeInput source="eventDateTime" label="通联活动时间" validate={required()}/>
            </SimpleForm>
        </Create>
    )
};